using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BUS;
using DAL;
using Entities;
using Utility;

public partial class admin_CapNhatKhachHang : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
      
    }
  
    protected void btn_Sua_Click(object sender, EventArgs e)
    {
        try
        {
            int id = int.Parse(Request.QueryString["id"].ToString());
            txt_MaKH.Text = id.ToString();
            tbKhachHang kh = tbKhachHangBUS.GetByID(id);
            kh.TenKH = txt_tenkh.Text;
            kh.TaiKhoan = txt_TaiKhoan.Text;
            kh.MatKhau = txt_matkhau.Text;
            kh.SoDT = txt_dienthoai.Text;
            kh.Email = txt_Email.Text;
            kh.DiaChi = txt_diachi.Text;

            tbKhachHangBUS.Uptate(kh);

        }
        catch
        {
            Response.Redirect("~/admin/DanhSachKhachHang.aspx");
            Response.Redirect(Request.RawUrl);
        }
    }
}
